<!--
 * @Author: wangming
 * @Date: 2020-09-07 10:06:15
 * @LastEditors: wangming
 * @LastEditTime: 2022-01-05 17:51:11
 * @Description: file content
-->
<template>
  <el-form
    @validate="validate"
    ref="form"
    :model="getModelForm"
    size="mini"
    class="p24 bz"
  >
    <template v-if="!!getModelForm.key">
      <slot v-bind:form="getModelForm"></slot>
    </template>
  </el-form>
</template>
<script>
import myMixin from "./myMixin";
import { mapActions, mapGetters } from "vuex";
export default {
  mixins: [myMixin],
  computed: {
    ...mapGetters(["getModelForm"]),
  },
  watch: {
    "getModelForm.key": function () {
      this.clearValidate();
    },
  },
  methods: {
    validate(label, flag) {
      if (!!this.getModelForm.__highSetUp)
        this.getModelForm.__highSetUp.formChecked = !flag;
    },
    clearValidate() {
      setTimeout(() => {
        this.$refs.form.clearValidate();
      });
    },
  },
};
</script>

<style lang="scss" scoped></style>
